home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / source / x11 / xconq.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-04  |  21.0 KB  |  610 lines  |  [TEXT/KAHL]

  1. /* Definitions for the X11 interface to Xconq.
  2.    Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995
  3.    Stanley T. Shebs.
  4.  
  5. Xconq is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.  See the file COPYING.  */
  9.  
  10. /* Default color of text and icons - 0 is for white on black, 1
  11.    is for black on white.  Should be set appropriately for the most
  12.    common monochrome display (color displays always do white on black).
  13.    This is also settable by the player, so the default is just for
  14.    convenience of the majority. */
  15.  
  16. #define BLACKONWHITE 1
  17.  
  18. #define BARGRAPHS
  19.  
  20. /* The default fonts can be altered by users, so these are just hints. */
  21.  
  22. #define TEXTFONT "fixed"
  23.  
  24. #define ICONFONT "xconq"
  25. #define STANDARD "standard"
  26.  
  27. /* Some X11 servers die if too much is written between output flushes. */
  28.  
  29. /* #define STUPIDFLUSH */
  30.  
  31. /* This is the name of a family of programs, so argv[0] inadequate. */
  32.  
  33. #define PROGRAMNAME "xconq"
  34. #define PROGRAMCLASSNAME "Xconq"
  35.  
  36. #include <X11/Xos.h>
  37. #include <X11/Xlib.h>
  38. #include <X11/Xutil.h>
  39. #include <X11/Xresource.h>
  40.  
  41. #include <X11/Intrinsic.h>
  42. #include <X11/StringDefs.h>
  43. #include <X11/Xaw/Box.h>
  44. #include <X11/Xaw/Form.h>
  45. #include <X11/Xaw/Paned.h>
  46. #include <X11/Xaw/Dialog.h>
  47. #include <X11/Xaw/Label.h>
  48. #include <X11/Xaw/Command.h>
  49. #include <X11/Xaw/Toggle.h>
  50. #include <X11/Xaw/List.h>
  51. #include <X11/Xaw/AsciiText.h>
  52. #include <X11/Xaw/Viewport.h>
  53. #include <X11/Xaw/Panner.h>
  54. #include <X11/Xaw/Porthole.h>
  55. #include <X11/Shell.h>
  56.  
  57. #include <X11/Xaw/Cardinals.h>
  58. #include <X11/Xaw/Toggle.h>
  59. #include <X11/Xaw/SmeBSB.h>
  60.  
  61. #include <math.h>
  62.  
  63. #include "imf.h"
  64. #include "ximf.h"
  65. #include "ui.h"
  66. /* (not ideal, since only needed here so feature-drawing code is available) */
  67. #include "print.h"
  68.  
  69. #ifndef IMFLIB
  70. #ifdef VMS
  71. #define IMFLIB "[-.lib-x11]"
  72. #else /* not VMS */
  73. #define IMFLIB "../lib-x11"
  74. #endif /* VMS */
  75. #endif /* IMFLIB */
  76.  
  77. enum grayshade {
  78.   gray,
  79.   darkgray,
  80.   numgrays
  81. };
  82.  
  83. /* Drawing techniques that may be used. */
  84.  
  85. enum whattouse {
  86.   dontdraw,
  87.   useblocks,
  88.   usepictures,
  89.   usefontchars,
  90.   usepolygons
  91. };
  92.  
  93. /* Types of controls. */
  94.  
  95. enum controltypeenum {
  96.     LOOK = 0,
  97.     MOVE,
  98.     UNIT_MOVE,
  99.     UNIT_SHOOT,
  100.     UNIT_BUILD,
  101.     SHOW_TERRAIN,
  102.     SHOW_GRID,
  103.     SHOW_UNITS,
  104.     SHOW_NAMES,
  105.     SHOW_FEATURE_NAMES,
  106.     SHOW_NUMBERS,
  107.     SHOW_PEOPLE,
  108.     SHOW_ELEV,
  109.     SHOW_TEMP,
  110.     SHOW_ALL,
  111.     SHOW_MORE,
  112.     COLR_UNITS,
  113.     COLR_TERR,
  114.     COLR_EMBL,
  115.     MONO_REVERSE,
  116.     ZOOM_OUT,
  117.     ZOOM_IN,
  118.     numcontrols
  119. };
  120.  
  121. /* Tools govern the interpretation of mouse clicks in a map view. */
  122.  
  123. enum tooltypes {
  124.   looktool,
  125.   movetool,
  126.   unitmovetool,
  127.   unitshoottool,
  128.   unitbuildtool,
  129. #ifdef DESIGNERS
  130.   terrainpainttool,
  131.   unitaddtool,
  132.   peoplepainttool,
  133.   featurepainttool,
  134. #endif /* DESIGNERS */
  135.   numtools
  136. };
  137.  
  138. /* The user interface substructure.  This is only allocated for sides with
  139.    attached displays. */
  140.  
  141. typedef struct a_ui {
  142.     Display *dpy;        /* The X display used by this side */
  143.     int active;            /* True when the display is usable */
  144.     int screen;            /* The X screen in use */
  145.     Widget shell;        /* Main shell for this side's displays */
  146.     Window rootwin;        /* The root window */
  147.     Pixel foreground;
  148.     Pixel background;
  149.     String geospec;
  150.     int mpTime;            /* # of milliseconds to pause between mplayer moves */
  151.     Atom kill_atom;
  152.     short bonw;            /* true if display is black-on-white */
  153.     short followaction;        /* move to where a change has occured */
  154.     short mayseeall;
  155.     int sxdown, sydown;
  156.     int    cellx, celly;
  157.     Boolean cellxy_ok;        /* cellx & celly valid? */
  158.     struct a_map *mapdown;
  159.     int beepcount;        /* number of times we've been beeped */
  160.     /* Constructed during display init. */
  161.     short monochrome;        /* obvious */
  162.     short fw, fh;        /* dimensions of text font (in pixels) */
  163.     /* Working variables for the display. */
  164.     long bgcolor;        /* background color */
  165.     long fgcolor;        /* foreground (text) color */
  166.     long whitecolor;        /* actual white for this display */
  167.     long blackcolor;        /* actual black for this display */
  168.     long enemycolor;        /* color for them (usually red) */
  169.     long neutcolor;        /* color for fencesitters (usually gray) */
  170.     long graycolor;        /* color for graying out (usually gray) */
  171.     long diffcolor;        /* unusual/distinct color (usually maroon) */
  172.     long goodcolor;        /* color for OKness (usually green) */
  173.     long badcolor;        /* color for non-OKness (usually red) */
  174.     long gridcolor;
  175.     long unseencolor;
  176.     long cellcolor[MAXTTYPES];    /* the color of each terrain type */
  177.     long cellfgcolor[MAXTTYPES]; /* the "fg" color of each terrain type */
  178.     long colors[MAXSIDES][3];
  179.     int numcolors[MAXSIDES];
  180.     long *unitcolors;
  181.     long *numunitcolors;
  182.     short dflt_color_unit_images;
  183.     short dflt_color_terr_images;
  184.     short dflt_color_embl_images;
  185.     GC gc;            /* a tmp graphics context for this display */
  186.     GC textgc;            /* foreground on background text */
  187.     GC ltextgc;            /* foreground on background text */
  188.     GC terrgc;            /* terrain display gc */
  189.     GC unitgc;            /* unit display gc */
  190.     GC emblgc;            /* emblem display gc */
  191.     XFontStruct *textfont;    /* Font for text display */
  192.     /* Map-related slots. */
  193.     struct a_map *maps;        /* Chain of maps that are up */
  194.     /* Help-related slots. */
  195.     Widget help_shell;
  196.     Widget help_form;
  197.     Widget help_topicPort;
  198.     Widget help_topicList;
  199.     Widget help_title;
  200.     Widget help_text;
  201.     Widget help_button_box;
  202.     Widget help_next;
  203.     Widget help_prev;
  204.     Widget help_back;
  205.     Widget help_close;
  206.     short helpw, helph;
  207.     struct a_helpnode *curhelpnode;
  208.     struct a_helpnode **nodestack;
  209.     int nodenumber, nodestackpos;
  210. #ifdef DESIGNERS
  211.     /* Design-related slots. */
  212.     Widget design_shell;
  213.     Widget design;
  214.     Widget normal_button;
  215.     Widget normal_label;
  216.     Widget terrain_button;
  217.     Widget terrain_label;
  218.     Widget unit_button;
  219.     Widget unit_label;
  220.     Widget people_button;
  221.     Widget people_label;
  222.     Widget feature_button;
  223.     Widget feature_label;
  224.     Widget brush_radius_label;
  225.     short curdesigntool;
  226.     short curbrushradius;
  227.     short curttype;
  228.     short curbgttype;
  229.     short curutype;
  230.     short curusidenumber;
  231.     short cursidenumber;
  232.     short curfid;
  233. #endif /* DESIGNERS */
  234.     /* Arrays of image families for units, terrain, and sides. */
  235.     ImageFamily **uimages;
  236.     ImageFamily **timages;
  237.     ImageFamily **eimages;
  238.     /* Terrain drawing machinery */
  239.     enum whattouse usewhat[NUMPOWERS][MAXTTYPES];
  240.     /* (should use as cache of image in image family - calc as needed) */
  241.     Pixmap terrpics[NUMPOWERS][MAXTTYPES];
  242.     char terrchars[NUMPOWERS][MAXTTYPES];
  243.     XFontStruct *terrfonts[NUMPOWERS][MAXTTYPES];
  244.     Pixmap hexpics[NUMPOWERS], bhexpics[NUMPOWERS];
  245.     Pixmap hexchars[NUMPOWERS], bhexchars[NUMPOWERS];
  246.     XFontStruct *hexfonts[NUMPOWERS], *bhexfonts[NUMPOWERS];
  247.     /* Unit drawing machinery */
  248.     Pixmap unitpics[NUMPOWERS][MAXUTYPES];
  249.     Pixmap unitmasks[NUMPOWERS][MAXUTYPES];
  250.     char unitchars[NUMPOWERS][MAXUTYPES];
  251.     XFontStruct *unitfonts[NUMPOWERS][MAXUTYPES];
  252.     XFontStruct *unitfont;    /* font for unit characters */
  253.     int unitw[NUMPOWERS][MAXUTYPES], unith[NUMPOWERS][MAXUTYPES];
  254.     /* Emblem drawing machinery */
  255.     Pixmap emblempics[MAXSIDES];
  256.     Pixmap emblemmasks[MAXSIDES];
  257.     int embw[MAXSIDES], embh[MAXSIDES];
  258.     /* Map legend drawing machinery */
  259.     XFontStruct *ulegendfonts[NUMPOWERS][MAXUTYPES];
  260.     XFontStruct *flegendfonts[6];
  261.     Font flegendfids[6];
  262.     Legend *legends;
  263.     int numfeatures;
  264.     /* Random stuff */
  265.     Pixmap bombpics[4];
  266.     Pixmap hitpics[3];
  267.     Pixmap controlpics[numcontrols];
  268.     Pixmap toolcursors[numtools];
  269.     Pixmap unitcursors[MAXUTYPES];
  270.     Pixmap boxcurs, boxmask;
  271.     Pixmap grays[numgrays];
  272. } UI;
  273.  
  274. /* Each side can open up any number and shape of maps. */
  275.  
  276. /* All the maps will share colors and bitmaps though. */
  277.  
  278. typedef struct a_map {
  279.     /* Widgets that make up the map. */
  280.     Widget mainwidget;
  281.     Widget leftpane;        /* lefthand area of window */
  282.     Widget leftform;        /*  */
  283.     Widget rightpane;        /* righthand area of window */
  284.     Widget infoform;        /* parts of leftform */
  285.     Widget controlform;        /* parts of leftform */
  286.     Widget *controls;        /* Array of controls */
  287.     Widget mapform;        /* parts of leftform */
  288.     Widget sideform;        /* parts of rightform */
  289.     Widget info;        /* Info about current pos/unit */
  290.     Widget porthole;
  291.     Widget portlabel;
  292.     Widget gamedate;        /* Overall game info */
  293.     Widget gameclock;        /* overall game info */
  294.     Widget msgarea;        /* miscellaneous info related to UI */
  295.     Widget sides;        /* List of sides */
  296.     Widget history;        /* Place for notices/warnings */
  297.     Widget promptlabel;
  298.     Widget listview;
  299.     Widget listform;
  300.     Widget *list_buttons;    /* numutypes+1 of these */
  301.     Widget pannerbox;
  302.     Widget panner;
  303.     Widget help_pop;
  304.     Widget ctrlpanel_pop;    /* View control popup */
  305.     Widget ctrlpanel_shell;    /* View control popup's shell */
  306.     Widget ctrlpanel_form;
  307.     Widget *ctrlpanel_buttons;    /* Array of buttons */
  308.     /* Raw windows that we draw into directly. */
  309.     Window infowin;        /* info about a unit and/or cell */
  310.     Pixmap viewwin;        /* actual graphical display of an area */
  311.     Window sideswin;        /* list of sides */
  312.     /* How to draw the map. */
  313.     short seeall;        /* True if viewing world data directly */
  314.     short drawterrain;        /* Display solid color terrain on the map? */
  315.     short drawgrid;        /* Draw outlines around cells? */
  316.     short drawcellpats;        /* Draw terrain patterns? */
  317.     short drawunits;        /* Display units on the map? */
  318.     short drawnames;        /* Display unit names/numbers on the map? */
  319.     short drawfeatureboundaries;
  320.     short drawfeaturenames;    /* true if displaying names of features */
  321.     short oldesttoshow;        /* the relative time of the oldest data */
  322.     short agetofade;        /* point at which to gray out the display */
  323.     short newesttoshow;        /* the relative time of the newest data */
  324.     short fadeterrain;        /* fade world features as well as units? */
  325.     short lowestlevel;        /* the lowest level of units to display */
  326.     short highestlevel;        /* the highest level of units to display */
  327.     short drawpeople;        /* true if displaying people sides */
  328.     short drawelevations;        /* true if display elevations */
  329.     short drawresources[MAXMTYPES];
  330.     short drawtemp;
  331.     short drawweather;
  332.     short use_color_unit_images;
  333.     short use_color_terr_images;
  334.     short use_color_embl_images;
  335.     short fullpanel;
  336.     /* Slots used for internal display calculations. */
  337.     VP *vp;            /* This map's generic view parameters */
  338.     short totalw, totalh;    /* Total size of window in pixels */
  339.     short leftfrac;
  340.     short leftw;
  341.     short pxw, pxh;        /* Size of map subwindow in pixels */
  342.     short toph;
  343.     short infoh;
  344.     short list1frac;
  345.     short list1w, list1h;
  346.     short list2w, list2h;
  347.     short panw, panh;
  348.     short vx, vy;        /* lower left of viewport in cell coords */
  349.     short vw, vh;        /* Boundaries of viewport in cell coords */
  350.     short vw2, vh2;        /* 1/2 (rounded down) of above values */
  351.     short sidespacing;        /* Vertical space for each side in side list */
  352.     short last_num_in_play[MAXUTYPES];
  353.     short last_num_incomplete[MAXUTYPES];
  354.     /* Interaction controls. */
  355.     short curtool;        /* Interpretation of left-mouse clicks */
  356.     short curx, cury;        /* Current spot being looked at */
  357.     struct a_unit *curunit;    /* Unit under cursor */
  358.     short savedcurx, savedcury;    /* Current spot being looked at (saved) */
  359.     struct a_unit *savedcurunit;/* Unit under cursor (saved) */
  360.     void (*modalhandler) PROTO ((Side *side, struct a_map *map, int cancelled));
  361.     char inpch;            /* Keyboard char */
  362.     short inptype;        /* Unit type clicked in unit type list */
  363.     short argint;        /* numerical prefix argument */
  364.     short argunitid;        /* should be unit id for safety */
  365.     struct a_side *argside;
  366.     short uvec[MAXUTYPES];    /* vector of allowed unit types to input */
  367.     char ustr[MAXUTYPES];    /* used in composing unit type hints */
  368.     short tvec[MAXTTYPES];    /* vector of allowed terrain types to input */
  369.     char tstr[MAXTTYPES];    /* used in composing terrain type hints */
  370.     char prompt[BUFSIZE];
  371.     char answer[BUFSIZE];
  372.     int tmpint;
  373.     /* Link to the next map. */
  374.     struct a_map *next;
  375. } Map;
  376.  
  377. /* Iteration over all of a side's map windows. */
  378.  
  379. #define for_all_maps(s,m)  \
  380.   for ((m) = (s)->ui->maps; (m) != NULL; (m) = (m)->next)
  381.  
  382. #define num_unit_colors(s,s2,u)  \
  383.   (((s)->ui->numunitcolors)[numutypes * (s2) + (u)])
  384.  
  385. #define unit_color(s,s2,u,n)  \
  386.   (((s)->ui->numunitcolors)[3 * (numutypes * (s2) + (u)) + (n)])
  387.  
  388. #define terrain_visible(s,x,y)  \
  389.   (g_see_all() || terrain_view((s), wrapx(x), (y)) != UNSEEN)
  390.  
  391. #define units_visible(s,x,y)  \
  392.   (g_see_all() || cover((s), wrapx(x), (y)) > 0)
  393.  
  394. /* Values shared by all displays and all sides. */
  395.  
  396. extern Widget thistoplevel;
  397. extern XtAppContext thisapp;
  398. extern int nargs;
  399. extern Arg tmpargs[];
  400.  
  401. /* Declarations of globally visible functions. */
  402.  
  403. extern int ask_unit_type PROTO ((Side *side, Map *map, char *prompt,
  404.                  int *poss,
  405.                  void (*handler)(Side *side, Map *map,
  406.                          int cancel)));
  407. extern int ask_terrain_type PROTO ((Side *side, Map *map, char *prompt,
  408.                     int *poss,
  409.                     void (*handler)(Side *side, Map *map,
  410.                             int cancel)));
  411. extern void ask_side PROTO ((Side *side, Map *map, char *prompt,
  412.                  Side *dflt,
  413.                  void (*handler)(Side *side, Map *map,
  414.                          int cancel)));
  415. extern void ask_position PROTO ((Side *side, Map *map, char *prompt,
  416.                  void (*handler)(Side *side, Map *map,
  417.                          int cancel)));
  418. extern void ask_bool PROTO ((Side *side, Map *map, char *prompt,
  419.                  int dflt, void (*handler)(Side *side, Map *map,
  420.                                int cancel)));
  421. extern void ask_string PROTO ((Side *side, Map *map, char *prompt, char *dflt,
  422.                    void (*handler)(Side *side, Map *map,
  423.                            int cancel)));
  424.  
  425. extern int grok_unit_type PROTO ((Side *side, Map *map, int *typep));
  426. extern int grok_terrain_type PROTO ((Side *side, Map *map, int *typep));
  427. extern int grok_side PROTO ((Side *side, Map *map, Side **side2p));
  428. extern int grok_position PROTO ((Side *side, Map *map, int *xp, int *yp));
  429. extern int grok_bool PROTO ((Side *side, Map *map));
  430. extern int grok_string PROTO ((Side *side, Map *map, char **strp));
  431.  
  432. extern int xform PROTO ((Side *side, Map *map, int x, int y,
  433.              int *sxp, int *syp));
  434. extern int x_xform_unit PROTO ((Side *side, Map *map, Unit *unit,
  435.                 int *sxp, int *syp, int *swp, int *shp));
  436. extern int x_xform_unit_self PROTO ((Side *side, Map *map, Unit *unit,
  437.                      int *sxp, int *syp, int *swp, int *shp));
  438. extern int x_xform_occupant PROTO ((Side *side, Map *map,
  439.                     Unit *transport, Unit *unit,
  440.                     int sx, int sy, int sw, int sh,
  441.                     int *sxp, int *syp, int *swp, int *shp));
  442. extern int x_nearest_cell PROTO ((Side *side, Map *map, int sx, int sy,
  443.                   int *xp, int *yp));
  444. extern int x_nearest_boundary PROTO ((Side *side, Map *map, int sx, int sy,
  445.                       int *xp, int *yp, int *dirp));
  446. extern int x_nearest_unit PROTO ((Side *side, Map *map, int sx, int sy,
  447.                   Unit **unitp));
  448.  
  449. extern void init_x_signal_handlers PROTO ((void));
  450.  
  451. extern void check_player_displays PROTO ((void));
  452. extern void init_all_displays PROTO ((void));
  453. extern void init_redraws PROTO ((void));
  454. extern void init_display PROTO ((Side *side));
  455. extern void set_colors PROTO ((Side *side));
  456. extern long request_color PROTO ((Side *side, char *name));
  457.  
  458. extern XFontStruct *open_font PROTO ((Side *side, char *name, char *xdefault,
  459.                       XFontStruct *altfont, char *alttype,
  460.                       Font *fid));
  461. extern Cursor make_cursor PROTO ((Display *dpy, Window win,
  462.                   char *cursbits, char *maskbits,
  463.                   unsigned long fg, unsigned long bg,
  464.                   unsigned int x, unsigned int y));
  465.  
  466. extern void reset_color_state PROTO ((Side *side));
  467. extern void reset_window_colors PROTO ((Side *side, Window win));
  468.  
  469. extern void execute_command PROTO ((Side *side, Map *map));
  470.  
  471. extern void set_current_unit PROTO ((Side *side, Map *map, Unit *unit));
  472. extern void set_current_xy PROTO ((Side *side, Map *map, int x, int y));
  473. extern void clear_current PROTO ((Side *side, Map *map));
  474. extern void save_cur PROTO ((Side *side, Map *map));
  475. extern void restore_cur PROTO ((Side *side, Map *map));
  476.  
  477. extern Map *create_map PROTO ((Side *side, int power, char *geospec));
  478.  
  479. extern void add_map_actions PROTO ((void));
  480.  
  481. extern void set_tool_cursor PROTO ((Side *side, Map *map));
  482.  
  483. extern void set_map_power PROTO ((Side *side, Map *map, int power));
  484. extern void x_center_on_focus PROTO ((Side *side, Map *map));
  485.  
  486. extern void handle_key_event PROTO ((Side *side, Map *map, XEvent *evt));
  487.  
  488. extern int find_side_and_map PROTO ((Widget w, Side **sidep, Map **mapp));
  489. extern int find_side_and_map_via_control PROTO ((Widget w,
  490.                          Side **sidep, Map **mapp));
  491. extern int find_side_and_map_via_listform PROTO ((Widget w,
  492.                           Side **sidep, Map **mapp));
  493. extern int find_side_and_map_via_mapform PROTO ((Widget w,
  494.                          Side **sidep, Map **mapp));
  495. extern int find_side_and_map_via_rightform PROTO ((Widget w,
  496.                            Side **sidep, Map **mapp));
  497. extern int find_side_and_map_via_a_toplevel PROTO ((Widget w,
  498.                             Side **sidep, Map **mapp));
  499. extern int find_side_and_map_via_porthole PROTO ((Widget w,
  500.                           Side **sidep, Map **mapp));
  501. extern int find_side_via_widget PROTO ((Widget w, Side **sidep));
  502.  
  503. extern void update_controls PROTO ((Side *side, Map *map));
  504.  
  505. extern void draw_all_maps PROTO ((Side *side));
  506.  
  507. extern void draw_map PROTO ((Side *side, Map *map));
  508. extern void draw_map_view PROTO ((Side *side, Map *map));
  509. extern void destroy_map PROTO ((Side *side, Map *map));
  510.  
  511.  
  512. extern void draw_row PROTO ((Side *side, Map *map,
  513.                  int x0, int y0, int len, int clearit));
  514. extern void draw_unit_image PROTO ((Side *side, Window win,
  515.                     int sx, int sy, int sw, int sh,
  516.                     int u, int s2, int fg, int bg));
  517. extern void draw_side_emblem PROTO ((Side *side, Window win,
  518.                      int ex, int ey, int ew, int eh,
  519.                      int s2, int style));
  520. extern void draw_current PROTO ((Side *side, Map *map));
  521. extern void erase_current PROTO ((Side *side, Map *map, int x, int y,
  522.                   Unit *unit));
  523.  
  524. extern void draw_prompt PROTO ((Side *side, Map *map));
  525. extern void clear_prompt PROTO ((Side *side, Map *map));
  526. extern void draw_map_info PROTO ((Side *side, Map *map));
  527. extern void draw_game_state PROTO ((Side *side, Map *map));
  528. extern void draw_game_clocks PROTO ((Side *side, Map *map));
  529. extern void draw_map_sides PROTO ((Side *side, Map *map));
  530. extern void draw_side_info PROTO ((Side *side, Map *map, Side *side2));
  531. extern void draw_side_progress PROTO ((Side *side, Map *map, Side *side2));
  532.  
  533. extern void put_on_screen PROTO ((Side *side, Map *map, int x, int y));
  534. extern int in_middle PROTO ((Side *side, Map *map, int x, int y));
  535.  
  536. extern void move_the_selected_unit PROTO ((Side *side, Map *map, Unit *unit,
  537.                        int sx, int sy));
  538.  
  539. extern void create_help PROTO ((Side *side));
  540. extern void popup_help PROTO ((Side *side));
  541. extern void popdown_help PROTO ((Side *side));
  542.  
  543. extern void recenter PROTO ((Side *side, Map *map, int x, int y));
  544.  
  545. extern void draw_text PROTO ((Side *side, Window win, int x, int y,
  546.                   char *str,int color));
  547. extern void draw_fg_text PROTO ((Side *side, Window win, int x, int y,
  548.                  char *str));
  549.  
  550. extern void textw_printf PROTO ((const Widget w, const char *fmt, ...));
  551.  
  552. extern int font_width PROTO ((XFontStruct *font));
  553. extern int font_height PROTO ((XFontStruct *font));
  554.  
  555. extern void close_display PROTO ((Side *side));
  556.  
  557. extern void exit_xconq PROTO ((Side *side));
  558.  
  559. extern void notify_all PROTO ((char *fmt, ...));
  560. extern void low_notify PROTO ((Side *side, char *str));
  561. extern void redraw PROTO ((Side *side));
  562. extern void flush_output PROTO ((Side *side));
  563. extern void beep PROTO ((Side *side));
  564.  
  565. extern void flush_input PROTO ((Side *side));
  566.  
  567. extern void build_name PROTO ((char *name, char *first, char *second));
  568.  
  569. extern void draw_view_in_panner PROTO ((Side *side, Map *map));
  570.  
  571. extern void set_message_area PROTO ((Map *map, char *msg));
  572.  
  573. extern void add_map_actions PROTO ((void));
  574.  
  575. extern void update_unit_type_list PROTO ((Side *side, Map *map, int u));
  576.  
  577. extern XawTextPosition widget_text_length PROTO ((Widget w));
  578.  
  579. extern void move_caret_to_end PROTO ((Widget w));
  580.  
  581. extern int popup_print_setup_dialog PROTO ((Side *side, PrintParameters *ps_pp));
  582.  
  583. extern int num_features PROTO ((void));
  584. void place_legends PROTO ((Side *side));
  585.  
  586. /* Declarations of all the command functions. */
  587.  
  588. #undef DEF_CMD
  589. #define DEF_CMD(letter,name,args,FN,help) \
  590.   void FN PROTO ((Side *side, Map *map));
  591.  
  592. #include "cmd.def"
  593.  
  594. #include "xcmd.def"
  595.  
  596. #ifdef DESIGNERS
  597. extern void create_design PROTO ((Side *side));
  598. extern void popup_design PROTO ((Side *side));
  599. extern void update_curttype PROTO ((Side *side));
  600. extern void update_curutype PROTO ((Side *side));
  601. extern void update_cursidenumber PROTO ((Side *side));
  602. extern void update_curfeature PROTO ((Side *side));
  603. extern void update_curbrushradius PROTO ((Side *side));
  604. extern void set_designer_cur_from_map PROTO ((Side *side, Map *map,
  605.                           int sx, int sy));
  606. extern void handle_designer_map_click PROTO ((Side *side, Map *map,
  607.                           int sx, int sy));
  608. extern void popdown_design PROTO ((Side *side));
  609. #endif /* DESIGNERS */
  610.